﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Configuration;

namespace WeakEndForum
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            OleDbConnection conn = new OleDbConnection(
            ConfigurationManager.ConnectionStrings[Constantes.DB_NAME].ConnectionString);
            conn.Open();
            OleDbCommand comm = new OleDbCommand("SELECT ID, Titre, Contenu, Date_publication, Auteur FROM Actualite ORDER BY Date_publication DESC;", conn);
            OleDbDataReader dataReader = comm.ExecuteReader();
            Modules.generateNews(dataReader, ref newsFeedPH);
            conn.Close();
        }
        protected bool isUserMod()
        {
            if (Modules.getConnectedUser() != null)
            {
                return Modules.isMod(Modules.getConnectedUser());
            }
            return false;
        }
    }
}